#include"processBar.h"
#include<unistd.h>
typedef void (*Fun_Back)(int);

void DownLoad(Fun_Back Fun){
           int total=1000;//download program has 1000MB;
           int aready =0;//aready download 0MB 
  while(aready<=total){
    int rate=aready*100/total;
    Fun(rate);
    usleep(300000);
    aready+=10;
  }
  putchar('\n');
}

int main(){
    printf("first application\n");
    Init();
    DownLoad(processBar2);
    
    printf("second application\n");
    Init();
    DownLoad(processBar2);

    printf("third  application\n");
    Init();
    DownLoad(processBar2);
    // int count=0;
    // processBar1(count);
    return 0;
}
